/**
 * 热更新版本号
 * @type {number}
 */
import { logger } from "../utils/util";

export const hotUpgradeVersionCode = 14;
export const isTest = GLOBAL.__DEV__ ? true : false;//发布上线要改成false
export const dev_webUrl = {
  api: "http://dev.xiongmaodangao.com/delivery", // dev
  // api: "http://192.168.31.211:5055/delivery", // wcw
  // api: "http://192.168.31.245:5055/delivery", // lxh
  // api: "http://192.168.31.21:5055/delivery", // wq
  // api: "https://delivery.xiongmaodangao.com/pre/api",
};

export const webUrl = {
  api: "https://delivery.xiongmaodangao.com/pre/api",
  // api: "http://47.107.248.124:5055/delivery",

};


//平台代号
export const platformCode = "PT202007291212";

//票类型
export const ticketTypes = [
  {
    label: "成人",
    type: 1,
  },
  {
    label: "儿童",
    type: 2,
  },
];

export const eventTypes = {
  CHANGE_TAB: "change_tab",//更改tab
  REFRESH_GROUP_CHAT: "refresh_group_chat",//刷新会话列表
};

export const redTypes = [
  {
    label: "普通红包",
    type: 1,
  },
  {
    label: "拼手气红包",
    type: 2,
  },
];

//证件类型
export const idTypes = [
  {
    label: "身份证",
    type: 1,
  },
  {
    label: "护照",
    type: 2,
  },
];
//支付状态
export const payStatus = [
  "", "待支付", "支付成功", "支付失败", "订单关闭", "已退款",
];

export const API = async () => {
  //测试环境
  const environment = await storage.load({
    key: 'environment',
  }).catch(logger);

  logger('环境3',environment)
  if(IsNullOrEmpty(environment) )
  {
    if(isTest){
      return dev_webUrl;
    } else {
      return webUrl;
    }
  }
  else{
    if (environment == 'DEV') {
      return dev_webUrl;
    } else {
      return webUrl;
    }
  }
};

/**
 * 营业状态
 * @param operateStatus
 * @returns {string}
 */
export const operateStatusStr = (operateStatus) => {
  switch (operateStatus) {
    case 1:
      return "营业";
    case 2:
      return "整顿";
    case 3:
      return "停业";
    case 4:
      return "关店";
  }
};

/**
 * 营业期限
 * @param approvedDate
 * @returns {string}
 */
export const operatingPeriodStr = (operatingPeriod) => {
  switch (operatingPeriod) {
    case 1:
      return "长期";
    case 2:
      return "非长期";
  }
};
/**
 * 审核状态
 * @param appStatus
 * @returns {string}
 */
export const appStatusStr = (appStatus) => {
  switch (appStatus) {
    case 1:
      return "待审核";
    case 2:
      return "已审核";
    case 3:
      return "已驳回";
  }
};

export const educationData = ["本科", "大专", "硕士", "博士", "高中", "初中"];
export const reasonData = [
  "城市超负荷(须上传本小时超3单的APP订单截图)",
  "生产超时(须上传生产群聊天记录截图)",
  "系统定位错误(须上传天使沟通群报备截图)",
  "中转不及时(须上传城市运力群聊天记录截图)",
  "其他(须上传证明图片)",
];
